<?php
namespace app\validate;
use share\validate\SceneValidate;

class AliyunProjectValidate extends SceneValidate{

    /**
     * 通用规则
     */
    protected $rule = [
        'id' => 'require|integer',
        'project_key' => 'require|length:1,60',
        'name' => 'require|length:1,60',
        'description' => 'require|length:1,100',
        'has_aliyun_cloud_access' => 'require|integer',
    ];    

    /**
     * 自定义场景的规则
     */
    protected $sceneRules = [
        // 'set' =>[
        //     'id' => 'require|integer',
        //     'level' => 'integer',
        //     'account' => 'length:2,16',
        //     'password' => 'length:6,20',
        //     'vendor' => 'length:2,20',
        // ],
        'list' => [
            'id' => 'integer',
            'project_key' => 'length:1,60',
            'name' => 'length:1,60',
            'description' => 'length:1,100',
            'has_aliyun_cloud_access' => 'integer',
        ],
    ];

    protected $scene = [
        'list' => ['id','project_key','name','description','has_aliyun_cloud_access'],
        'set' => ['id','project_key','name','description','has_aliyun_cloud_access'],
        'del'  => ['id'],
    ];
}
